package com.tesis_2.UI;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RatingBar;
import android.widget.TextView;

import com.example.tesis_2.R;
import com.tesis_2.BL.BLRestaurants;
import com.tesis_2.DA.DAOUtils;
import com.tesis_2.DA.ImageDownloader;
import com.tesis_2.MO.Restaurant;



public class RestaurantDetailItem  extends Fragment {
	
	 
	public static final String ARG_SECTION_NUMBER = "section_number";
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
             Bundle savedInstanceState) {
		
		// Inflate the layout for this fragment
		View fragmentView	= inflater.inflate(R.layout.activity_restaurant_detail_item, container, false);
		Bundle args = getArguments();
		Restaurant objRest = BLRestaurants.getLsRest().get(args.getInt("nRest"));
		
		TextView txV =((TextView) fragmentView.findViewById(R.id.txvNombre_restaurant_detail_item));
		txV.setText(objRest.getName());
		
		((TextView) fragmentView.findViewById(R.id.txvDescrpcion_restaurant_detail_item)).setText(objRest.getDescr());
		((RatingBar) fragmentView.findViewById(R.id.ratingBar1)).setRating(objRest.getScore());
		//ImageDownloader mDownload = new ImageDownloader();
		
		
		//mDownload.download(DAOUtils.getServer()+"/assets/restaurants/"+ objRest.getId()  +"/small/" + objRest.getPhoto(), ((ImageView) fragmentView.findViewById(R.id.imgRest_locales_detail_item)));

		
		return  fragmentView;
	
	}

}
